﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Phone_OffinePlayerContol : MonoBehaviour
{
    // Start is called before the first frame update
    private CharacterController cc;
    public float moveSpeed = 5;
    private float horizontalWrapMode, verticalMove;
    private Vector3 dir;
    public Joystick joystick;

    private void Awake()
    {
        cc = GetComponent<CharacterController>();
    }

    // Update is called once per frame
    void Update()
    {

        horizontalWrapMode = joystick.Horizontal * moveSpeed;
        verticalMove = joystick.Vertical * moveSpeed;
        dir = transform.forward * verticalMove;

        //transform.Rotate(0, horizontalWrapMode / 10, 0);

        //transform.rotation = Quaternion.AngleAxis(horizontalWrapMode * 20, Vector3.up);

        cc.Move(dir * Time.deltaTime);
    }
}
